package com.sailfish.springbootdemo.utils.redis;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class Publisher {

    private final RedisTemplate<String, String> redisTemplate;

    public Publisher(RedisTemplate<String, String> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    public void publishMessage_getAllBoardListByPagination(String message) {
        redisTemplate.convertAndSend(TopicConfig.getAllBoardListByPagination, message);
    }

    public void publishMessage_test(String message) {
        redisTemplate.convertAndSend(TopicConfig.test, message);
    }
}
